import {createRouter,createWebHistory} from "vue-router"
import Login from "@/modules/login/login.vue"
import System from "@/modules/system/system.vue"

import SystemHomePage from "@/modules/systemHomePage/systemHomePage.vue"

import UserManagement from "@/modules/systemManagement/userManagement/userManagement.vue"
import Announcements from "@/modules/systemManagement/announcements/announcements.vue"

import OlderManManagement from "@/modules/oldManManagement/olderManManagement/olderManManagement.vue"
import HealthManagement from "@/modules/oldManManagement/healthManagement/healthManagement.vue"
import FamilyManagement from "@/modules/oldManManagement/familyManagement/familyManagement.vue"

import ConsultManagement from "@/modules/hospitalityManagement/consultManagement/consultManagement.vue"
import VisitManagement from "@/modules/hospitalityManagement/visitManagement/visitManagement.vue"

import CareMessageManagement from "@/modules/careManagement/careMessageManagement/careMessageManagement.vue"
import CareDailyManagement from "@/modules/careManagement/careDailyManagement/careDailyManagement.vue"

import BedMessageManagement from "@/modules/bedManagement/bedMessageManagement/bedMessageManagement.vue"

const router = createRouter({
  history: createWebHistory(),
  routes:[
    {path:'/',redirect:'/login'},//重定向到登录页面
    {path:'/login',component:Login,name:'login' },
    {
      path:'/system',component:System,name:'system',
      children:[
        {path:'/system',redirect:'/systemHomePage'},//重定向到系统首页
        
        // 系统主页
        {path:'/systemHomePage',component:SystemHomePage,name:'systemHomePage',meta:{title:'系统主页',parent:'系统主页'}},

        // 系统管理
        {path:'/userManagement',component:UserManagement,name:'userManagement',meta:{title:'用户管理',parent:'系统管理'}},
        {path:'/announcements',component:Announcements,name:'announcements',meta:{title:'通知公告',parent:'系统管理'}},

        // 老人管理
        {path:'/olderManManagement',component:OlderManManagement,name:'olderManManagement',meta:{title:'老人信息管理',parent:'老人管理'}},
        {path:'/healthManagement',component:HealthManagement,name:'healthManagement',meta:{title:'老人健康管理',parent:'老人管理'}},
        {path:'/familyManagement',component:FamilyManagement,name:'familyManagement',meta:{title:'家属信息管理',parent:'老人管理'}},
        
        // 接待管理
        {path:'/consultManagement',component:ConsultManagement,name:'consultManagement',meta:{title:'未入院到访管理',parent:'接待管理'}},
        {path:'/visitManagement',component:VisitManagement,name:'visitManagement',meta:{title:'入院老人探访者管理',parent:'接待管理'}},

        // 护工管理
        {path:'/careMessageManagement',component:CareMessageManagement,name:'careMessageManagement',meta:{title:'护工信息管理',parent:'护工管理'}},
        {path:'/careDailyManagement',component:CareDailyManagement,name:'careDailyManagement',meta:{title:'护工日常工作管理',parent:'护工管理'}},

        // 床位管理
        {path:'/bedMessageManagement',component:BedMessageManagement,name:'bedMessageManagement',meta:{title:'床位信息管理',parent:'床位管理'}},

      ]
    },
  ]
})

export default router